<?php
require('fpdf.php');

class PDF extends FPDF
{
    function Header()
    {
        $this->Image('pics\logo.jpg', 10, 5, 15, 15);
        $this->SetFont('Arial','B',16);
        $this->SetTextColor(00, 180, 00);
        $this->Cell(50);
        $this->Cell(50,10,'Automated Employee Management System', 0, 1, 'C');
        $this->Line(10, 25, 200, 25);
    }

    function LoadData($file)//Setup data for populating the table
    {
        $lines = file($file);
        $data = array();
        foreach($lines as $line)
            $data[] = explode(';',trim($line));
        return $data;
    }
    
    function SetProfileHeader($data)//Setup Attendance Report (DATE), Attendance Picture and Employee First Name
    {
        $this->Cell(20,20,'Employee Record');
        $this->SetXY(25,28);
        $this->Image('pics\record_many.jpg',10,33,null,10);
        $this->SetFont('Arial','B',12);
        $this->Cell(10, 20, 'Employee Profiles');
    }
}
/*Declare Variables Here*/
$profheader = array
    (
    'first'=>'Terence Anton',
    'middle'=>'Chong',
    'last'=>'Dela Fuente',
    'position'=>'System Admin'
    );

$header = array('Date','Time In','Time Out','Overtime Hours','Remarks');

/*End of Declaration*/

/*Main*/
$pdf = new PDF();
$pdf->AddPage();
$file = $pdf->LoadData('bla.txt');
$pdf->SetProfileHeader($profheader);
$pdf->Ln(45);
//$pdf->Table($header, $file);
$pdf->Output();
/*End of Main*/
?>
